package com.kwm.Exception;

import com.kwm.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class DealException {

    @ExceptionHandler
    public Result doException(Exception e){
        log.error("全局异常处理器{}",e);
        return Result.error("对不起，服务器异常，请稍后再试");

    }
}
